const mongoose = require('mongoose')
const Schema = mongoose.Schema;

const ArtSchema = new Schema({
  title: {
    type: String
  },
  body_html: {
    type: String
  },
  body_md: {
    type: String
  },
  create_user: {
    type: String
  },
  class_name: {
    type: String
  },
  tags: {
    type: Array
  },
  look_number: {
    type: Number
  },
  give_like_number: {
    type: Number
  },
  collect_number: {
    type: Number
  },
  //自动获取创建时间和更新时间
},{timestamps: {createdAt: 'create_time', updatedAt: 'update_time'}})

module.exports = Article = mongoose.model("article", ArtSchema)